package com.example.controller;

import com.example.entity.supervision.PlanDict;
import com.example.service.PlanDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * Created by simon on 2018/8/7.
 * 计划目录
 */
@RestController
@RequestMapping("api/planDict")
public class PlanDictController {

    @Autowired
    PlanDictService planDictService;


    /**
     * 新增计划目录
     * @param map
     * @return
     */
    @RequestMapping(value = "/addPlanDict", method = RequestMethod.POST)
    Map<String, Object> add(@RequestBody PlanDict map) {
        return planDictService.add(map);
    }

    /**
     * 删除 计划目录
     * @param map
     * @return
     */
    @RequestMapping(value = "/deletePlanDict", method = RequestMethod.POST)
    Map<String, Object> delete(@RequestBody Map map) {
        return planDictService.delete(map);
    }


    /**
     *  修改 计划目录
     * @param map
     * @return
     */
    @RequestMapping(value = "/updatePlanDict", method = RequestMethod.POST)
    Map<String, Object> update(@RequestBody Map map) {
        return planDictService.update(map);
    }


    /**
     *  查询 计划目录
     * @param map
     * @return
     */
    @RequestMapping(value = "/queryPlanDict", method = RequestMethod.POST)
    Map<String, Object> query(@RequestBody PlanDict map) {
        return planDictService.query(map);
    }


    /**
     * 新增计划目录
     * @param file
     * @return
     */
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    Map<String, Object> inExcel(@RequestBody MultipartFile file) {
        return planDictService.inExcel(file);
    }




}
